import {createRouter,createWebHistory} from 'vue-router';
import group from '@/page/group.vue';
import message from '@/page/message.vue';
import shop from '@/page/shop.vue';
import user from '@/page/user.vue';
import home from '@/page/home.vue';
import group_t1 from '@/componets/group_t1.vue';
import group_t2 from '@/componets/group_t2.vue';
import other from '@/componets/other.vue';
import login from '@/componets/login.vue';
import regiust from '@/componets/regiust.vue';
import product from '@/componets/product.vue';
const router=createRouter({
    history:createWebHistory(),
    routes:[
      {
        path:'/',
        name:'home',
        component:home,
        props:true,
      },
        {
        path:'/product/:id',
        name:'product',
        component:product,
        props:true,
      },
      {
        path:'/group',
        name:'group',
        component:group,
        props:true,
        children:[
          {
            path:'/group_t1',
            name:'group_t1',
            component:group_t1,
            props:true
          },
          {
            path:'/group_t2',
            name:'group_t2',
            component:group_t2,
            props:true

          },
          {
            path:'/other',
            name:'other',
            component:other,
            props:true,
          },
        ]
      },
      {
        path:'/message',
        name:'message',
        component:message,
        props:true,
      },
      {
        path:'/shop',
        name:'shop',
        component:shop,
        props:true,
      },
      {
        path:'/user',
        name:'user',
        component:user,
        props:true,
        children:[{
          path:'/login',
          name:'login',
          component:login,
          props:true,
        },{
          path:'/regiust',
          name:'regiust',
          component:regiust,
          props:true,
        }]
      },
    ]
})
export default router;
